package com.e3roid.examples;

import android.graphics.Bitmap;
import com.e3roid.E3Activity;
import com.e3roid.E3Engine;
import com.e3roid.E3Scene;
import com.e3roid.drawable.Background;
import com.e3roid.util.BitmapUtil;
import com.e3roid.util.Debug;

public class TiledBackgroundExample extends E3Activity {

	private final static int WIDTH  = 320;
	private final static int HEIGHT = 480;
	
	@Override
	public E3Engine onLoadEngine() {
		E3Engine engine = new E3Engine(this, WIDTH, HEIGHT);
		engine.requestFullScreen();
		engine.requestPortrait();
		return engine;
	}

	@Override
	public E3Scene onLoadScene() {
		E3Scene scene = new E3Scene();

		// load tile with 32x32, tile no.3, 1px border
		Bitmap tile = BitmapUtil.getTileBitmapFromAsset(
				"tile_border.png", 32, 32, 2, 0, 1, this);
		Background background = new Background(tile, getWidth(), getHeight(), this);
		scene.getTopLayer().setBackground(background);
		return scene;
	}

	@Override
	public void onLoadResources() {
		Debug.d("onLoadResource");
	}

}